<div style="position: fixed; background: #ffffff; z-index: 999999999; height: calc(100% - 264px); top: 158px; right: 0px; border: 1px solid #e6e6e6; padding: 10px; width: 400px; overflow: hidden; transition: all 0.6s; display: none;" id="bjd_select_goods">
	<div style="line-height: 30px; "><h2>选择报价商品</h2></div>
	<div class="select-data-box" style="line-height: 24px; height: calc(100% - 110px);  overflow-y: auto; background: #fafafa; padding: 10px; margin: 10px 0px;">
		
	</div>
	<div style="position: absolute; width: 400px; right: 10px; bottom: 10px; display: flex; justify-content: space-between;z-index: 9999999999; background: #ffffff;">
		<a type="button" data-title="取消导出" class="layui-btn layui-btn-primary layui-btn" lay-event="closeCgGoods">取消导出</a>
		<a type="button" data-title="导出报价单" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="exportCgGoods"><i class="layui-icon layui-icon-spread-left"></i>导出报价单</a>
	</div>
</div>
<div class="search-box">
	<form class="search_form layui-form" lay-filter="goods_jun_search_form">
		<div class="layui-inline">
			<label class="layui-form-label">分类</label>
			<div class="layui-input-inline">
				<select name="category_sign1" id="category_search1" lay-filter="list_category_search1" lay-search>
				</select>
			</div>
			<div class="layui-input-inline">
				<select name="category_sign2" id="category_search2" lay-filter="list_category_search2" lay-search>
				</select>
			</div>
			<div class="layui-input-inline">
				<select name="category_sign3" id="category_search3" lay-filter="list_category_search3" lay-search>
				</select>
			</div>
		</div>
		<div class="layui-inline search-radio-box">
			<div class="layui-input-inline">
			    <label class="layui-form-label">销售状态</label>
				<input type="radio" name="sale_state" value="1" title="上架" checked="">
				<input type="radio" name="sale_state" value="2" title="下架">
				<input type="radio" name="sale_state" value="-1" title="全部">
			</div>
		</div>
		<div class="layui-inline search-radio-box">
			<div class="layui-input-inline">
			    <label class="layui-form-label">锁定状态</label>
			    <input type="radio" name="is_lock" value="" title="全部" checked="">
			    <input type="radio" name="is_lock" value="2" title="未锁定">
				<input type="radio" name="is_lock" value="1" title="锁定">
			</div>
		</div>
		<div class="layui-inline search-radio-box">
			<div class="layui-input-inline">
				<input type="radio" name="jun_price_flag" value="" title="价格变动" checked>
				<input type="radio" name="jun_price_flag" value="1" title="未变动">
				<input type="radio" name="jun_price_flag" value="2" title="已变动">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">名称</label>
			<div class="layui-input-inline">
				<input type="text" name="goods_name" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">编号</label>
			<div class="layui-input-inline">
				<input type="text" name="goods_sku" autocomplete="off" class="layui-input">
			</div>
		</div>
	<div class="layui-inline">
			<label class="layui-form-label">军网编号</label>
			<div class="layui-input-inline">
				<input type="text" name="jun_id" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">限价</label>
			<div class="layui-input-inline">
				<input type="text" name="min_price" autocomplete="off" class="layui-input" placeholder="最低限价">
			</div>
			<div class="layui-input-inline">
				<input type="text" name="max_price" autocomplete="off" class="layui-input" placeholder="最高限价">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">报价</label>
			<div class="layui-input-inline">
				<input type="text" name="min_api_price" autocomplete="off" class="layui-input" placeholder="最低报价">
			</div>
			<div class="layui-input-inline">
				<input type="text" name="max_api_price" autocomplete="off" class="layui-input" placeholder="最高报价">
			</div>
		</div>

		<div class="layui-inline">
			<button type="button" class="layui-btn layui-btn-normal layui-btn-sm baojia">报价10%以内商品</button>
		</div>
			<div class="layui-inline">
			<label class="layui-form-label">型号</label>
			<div class="layui-input-inline">
				<input type="text" name="goods_model" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">发布时间</label>
			<div class="layui-input-inline">
				<input type="text" name="goods_form_create_time_start" autocomplete="off" class="layui-input" placeholder="开始日期">
			</div>
			<div class="layui-input-inline">
				<input type="text" name="goods_form_create_time_end" autocomplete="off" class="layui-input" placeholder="结束日期">
			</div>
		</div>
		<div class="layui-inline">
			<div class="layui-input-inline">
				<button type="button" id="jun_search_btn"
					class="layui-btn layui-btn-normal layui-btn-sm layui-bg-red">搜 索</button>
			</div>
		</div>
		<div class="pack-up"></div>
	</form>
</div>
<table class="layui-hide" id="goods_jun_list" lay-filter="goods_jun_list"></table>
<script>
	
	var goods_jun_list_url = "{:url('Goods/ajaxList',array('pre_info'=>'jun'))}",
		goods_delete_url = "{:url('Goods/ajaxDelete')}",
		goods_up_url = "{:url('Goods/ajaxUp')}",
		goods_down_url = "{:url('Goods/ajaxDown')}",
		goods_one_url = "{:url('Goods/ajaxOneData')}",
		goods_save_url = "{:url('Goods/saveData')}",
		goods_copy_url = "{:url('Goods/copy')}",
		goods_collect_url = "{:url('Goods/collect')}",
		category_select_uri = "{:url('Category/ajaxCategory')}",
		brand_select_uri = "{:url('Brand/ajaxList')}",
		goods_jun_cols = {$cols},
		goods_select_site_id = '',
		goods_upload_url = "{:url('goods/upload')}",
		goods_jun_comm = "{:url('goods/implodeGoodsComm')}",
		goods_jun_baojia = "{:url('goods/junBaojia')}",
		goods_transfer_url = "{:url('goods/transfer')}",
		site_data_url = "{:url('goods/siteData')}",
		goods_export_url = "{:url('goods/exportGoods')}",
		goods_export_cg_url = "{:url('goods/exportCgGoods')}",
		goods_delete_url = "{:url('goods/ajaxDelete')}",
		audit_log_url = "{:url('audit/auditLog')}",
		site_id = "{$site_id}",
		post_log_url = "{:url('goods/postJunLog')}",
		price_log_url = "{:url('goods/priceLog')}",
		chk_today_baojia_url = "{:url('goods/chkTodayBaojia')}",
		jun_down_url = "{:url('goods/junDown')}",
		import_goods_url = "{:url('goods/importGoods')}",
		site_name = '{$get_site.site_name}';

	if($('form[lay-filter="goods_search_form"]').find('select[name="site_id"]').length == 1) {
		goods_select_site_id = $('form[lay-filter="goods_search_form"]').find('select[name="site_id"]').val();
	}
	$.getScript('/static/js/goods/jun.js');
</script>
<script type="text/html" id="goodsjunToolbar">
	<div class="layui-btn-container">
		<a type="button" data-title="导出产品" data-url="{:url('goods/export')}" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="exportGoods">导出产品</a>
		<a type="button" data-title="导出报价单" data-url="{:url('goods/exportCgGoods')}" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="setExportCgGoods">导出报价单</a>
		{if condition="menuAuth('goods_jctybj')"}
		<a type="button" data-title="军采统一报价" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="createExportCgGoods">军采统一报价</a> 
		{/if}
		{if condition="menuAuth('goods_tbsj')"}
		<a type="button" data-title="同步数据" class="layui-btn layui-btn-normal layui-btn-sm" id="tongbushuju" lay-event="tongbushuju">同步数据</a>
		{/if}
		{if condition="menuAuth('goods_caiji')"}
		<a type="button" data-title="采集昨日重点产品" href="http://tailongji.dixintong.com/jun/api/callet/page/1.html" target="_blank" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="exportAllOrder">采集今日</a>
	    <a type="button" data-title="采集今日重点产品" href="http://tailongji.dixintong.com/jun/api/daycallet/page/1.html" target="_blank" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="exportAllOrder">采集昨日</a>
		<a type="button" data-title="采集自选产品" href="http://tailongji.dixintong.com/jun/api/callet/page/1.html" target="_blank" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="exportAllOrder">采集自选</a>
		{/if}
		{if condition="menuAuth('goods_tbjwbj')"}
		<a type="button" data-title="同步军网报价" class="layui-btn layui-btn-normal layui-btn-sm" id="tongbubaojia" lay-event="tongbubaojia">同步军网报价</a>
		{/if}
		{if condition="menuAuth('goods_tbjwbj')"}
		<button type="button" class="layui-btn layui-btn-sm" lay-event="upGoods">上架</button>
		<button type="button" class="layui-btn layui-btn-sm" lay-event="downGoods">下架</button>
		{/if}
		<div class="layui-btn-group">
		<a data-title="军网下架" class="layui-btn layui-btn-warm layui-btn-sm layui-bg-cyan up-ju-down" lay-event="junDown">军网下架</a>
		</div>
		<a type="button" data-title="导入CSV" class="layui-btn layui-btn-normal layui-btn-sm" id="daorucsv" style="display:none">导入CSV</a>
		{if condition="menuAuth('goods_zuidijia')"}
		<a type="button" data-title="追最低价报价" href="https://tailongji.dixintong.com/supplier/buildtpl/pushBottom" target="_blank" class="layui-btn layui-btn-warm layui-btn-sm">追最低价</a>
		{/if}
		{if condition="menuAuth('import_goods_mul')"}
		<div class="layui-btn-group">
			<a data-title="导入自选库商品" class="layui-btn layui-btn-warm layui-btn-sm layui-bg-green up-import-goods">导入商品</a>
			<a data-title="模板" class="layui-btn layui-btn-warm layui-btn-sm layui-bg-blue" href="/public/导入自选库商品模板.xls" target="_blank">模板</a>
		</div>
		{/if}
	</div>
</script>
<script type="text/html" id="goods_jun_tool">
	<div class="layui-btn-group">
	
	{{# if(d.sale_state == 1 ){ }}
		<a class="layui-btn layui-btn-normal layui-btn-xs tap-nav" lay-event="edit" data-id="edit_goods_{{ d.goods_sku}}" data-url="{:url('goods/tplFormJun')}?goods_sku={{ d.goods_sku}}" data-title="商品报价"><i class="layui-icon layui-icon-edit"></i></a>
	{{# } else {}}
<a class="layui-btn layui-btn-normal layui-btn-xs tap-nav" lay-event="edit" data-id="edit_goods_{{ d.goods_sku}}" data-url="{:url('goods/tplFormJun')}?goods_sku={{ d.goods_sku}}" data-title="商品报价"><i class="layui-icon layui-icon-edit"></i></a>
	{{# } }}
	<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="price_log" data-title="价格日志"><i
	        class="layui-icon layui-icon-log"></i></a>
	</div>
</script>
<script type="text/html" id="goods_picture2Tpl">
	{{# if(d.goods_picture){ return '<a data-title="<img src='+d.goods_picture.save_path+' width=182 />" class="layui-btn layui-btn-sm" style="background-color:#fff;"><img src="'+d.goods_picture.save_path+'" /></a>'; } }}
</script>
<script type="text/html" id="is_realTpl">
	{{# if(d.is_real == 1 || d.is_real == true){ }}
	<input type="checkbox" name="is_real" lay-skin="switch" checked lay-text="是|否" disabled=""> {{# } else { }}
	<input type="checkbox" name="is_real" lay-skin="switch" lay-text="是|否" disabled=""> {{# } }}
</script>
<script type="text/html" id="is_shoppingTpl">
	{{# if(d.is_shopping == 1 || d.is_shopping == true){ }}
	<input type="checkbox" name="is_shopping" lay-skin="switch" checked lay-text="是|否" disabled=""> {{# } else { }}
	<input type="checkbox" name="is_shopping" lay-skin="switch" lay-text="是|否" disabled=""> {{# } }}
</script>
<script type="text/html" id="goods_nameTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.goods_name}}</strong></font>
	{{# } else {}}
	{{d.goods_name}}
	{{# }}}
</script>
<script type="text/html" id="category_nameTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.category_name}}</strong></font>
	{{# } else {}}
	{{d.category_name}}
	{{# }}}
</script>
<script type="text/html" id="jun_brand_nameTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.jun_brand_name}}</strong></font>
	{{# } else {}}
	{{d.jun_brand_name}}
	{{# }}}
</script>
<script type="text/html" id="beizhuTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.beizhu}}</strong></font>
	{{# } else {}}
	{{d.beizhu}}
	{{# }}}
</script>
<script type="text/html" id="jun_idTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.jun_id}}</strong></font>
	{{# } else {}}
	{{d.jun_id}}
	{{# }}}
</script>
<script type="text/html" id="zuidijiaTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.jun_zuidijia}}</strong></font>
	{{# } else {}}
	{{d.jun_zuidijia}}
	{{# }}}
</script>
<script type="text/html" id="sale_priceTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.sale_price}}</strong></font>
	{{# } else {}}
	{{d.sale_price}}
	{{# }}}
</script>
<script type="text/html" id="api_priceTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.api_price}}</strong></font>
	{{# } else {}}
	{{d.api_price}}
	{{# }}}
</script>
<script type="text/html" id="caigoujiaTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.caigoujia}}</strong></font>
	{{# } else {}}
	{{d.caigoujia}}
	{{# }}}
</script>
<script type="text/html" id="chengbenjiaTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.chengbenjia}}</strong></font>
	{{# } else {}}
	{{d.chengbenjia}}
	{{# }}}
</script>
<script type="text/html" id="goods_beizhu1Tpl">
	{{# if(d.goods_beizhu1 !== null){}}
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.goods_beizhu1}}</strong></font>
	{{# } else {}}
	{{d.goods_beizhu1}}
	{{# }}}
	{{# } else {}}
	
	{{# }}}
</script>
<script type="text/html" id="goods_skuTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.goods_sku}}</strong></font>
	{{# } else {}}
	{{d.goods_sku}}
	{{# }}}
</script>
<script type="text/html" id="create_timeTpl">
	{{# if(d.view_stock == 4){}}
	<font color="#ff0000"><strong>{{d.create_time}}</strong></font>
	{{# } else {}}
	{{d.create_time}}
	{{# }}}
</script>
<script type="text/html" id="is_installTpl">
	{{# if(d.is_install == 1 || d.is_install == true){}}
	<div class="layui-anim circle layui-bg-blue" data-title="需要">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="不需要">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<script type="text/html" id="jun_price_flagTpl">
	{{# if(d.jun_price_flag == 1){}}
	<div class="layui-anim circle layui-bg-green" data-title="未变动">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="已变动">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>


<script type="text/html" id="sale_stateTpl">
	{{# if(d.sale_state == 1 || d.sale_state == true){}}
	<div class="layui-anim circle layui-bg-green" data-title="上架">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else if(d.sale_state == 2){ }}
	<div class="layui-anim circle layui-bg-black" data-title="下架">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="删除">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>

<script type="text/html" id="is_lockTpl">
	{{# if(d.is_lock == 1){}}
	<div class="layui-anim circle layui-bg-red" data-title="已锁定">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-green" data-title="未锁定">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<script type="text/html" id="is_pushTpl">
	{{# if(d.is_push == 1){}}
	<div class="layui-anim circle layui-bg-green" data-title="已报价">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="未报价">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<script type="text/html" id="price_warmTpl">
	{{# if(d.price_warm == 1){}}
	<div class="layui-anim circle layui-bg-green" data-title="小于10%">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else if(d.price_warm == 2){ }}
	<div class="layui-anim circle layui-bg-orange" data-title="大于10%">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="高于报价">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<script type="text/html" id="audit_stateTpl">
	{{# if(d.audit_state == 1){}}
	<div class="layui-anim circle layui-bg-blue" data-title="通过">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else if(d.audit_state == 0){ }}
	<div class="layui-anim circle layui-bg-orange" data-title="等待">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# } else {}}
	<div class="layui-anim circle layui-bg-red" data-title="驳回">
		<i class="layui-icon layui-icon-radio"></i>
	</div>
	{{# }}}
</script>
<style type="text/css">
	.jun_input{
		display: none;
	}
</style>